import Vue from 'vue'
import VueRouter from 'vue-router'
// import VueRouter  from './Router';
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:"/layout"
  }, {
    path: '/login',
    name: 'login',
    component: () => import("../views/Login.vue")
  },
  {
    path: '/layout',
    name: 'layout',
    component: () => import('../views/Layout.vue'),
    // redirect:"/user",
    children: [
      {
        path: '/user',
        name: 'user',
        component: () => import("../views/User.vue")
      }, {
        path: '/goods',
        name: 'goods',
        component: () => import("../views/Goods.vue")
      }
    ]
  }, {
    path: '/about',
    name: 'about',
    component: () => import("../views/AboutView.vue")
  }
];

const router = new VueRouter({
  base: window.__POWERED_BY_QIANKUN__ ? '/vue2_app' : '/',
  mode:"history",
  routes,
})

export default router
